<template>
  <div class="container-page-allorder-navbar">
    <van-tabs v-model="active" class="group-tabs" :animated="true" :swipeable="true">
      <van-tab class="item-tabs" title="全部">
        <pageAll page-type="1" />
      </van-tab>
      <van-tab class="item-tabs" title="待付款">
        <pageAll page-type="2" />
      </van-tab>
      <van-tab class="item-tabs" title="待发货">
        <pageAll page-type="3" />
      </van-tab>
      <van-tab class="item-tabs" title="待收货">
        <pageAll page-type="4" />
      </van-tab>
      <van-tab class="item-tabs" title="已完成">
        <pageAll page-type="5" />
      </van-tab>
      <van-tab class="item-tabs" title="售后">
        <pageAll page-type="6" />
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import pageAll from './pages/page-all'
export default {
  components: { pageAll },
  data() {
    return {
      active: 1
    }
  },
  async mounted() {
    // 获取params
    await this.getParams()
  },
  methods: {
    // 获取params
    async getParams() {
      const { nowPage = 0 } = this.$route.params
      this.active = nowPage
    }
  }
}
</script>

<style lang="less">
.container-page-allorder-navbar {
  .item{
    &-tabs{
      height: calc(100vh - 45px - 44px);
      overflow-y: scroll;
    }
  }
}
 .van-tab {
    flex-basis: calc(100% / 6)!important;
  }
  .van-tab__pane{
    height: 100%;
  }
</style>
